import ModuleManager, { ModuleID } from "../../../cfw/module/ModuleManager";
import { ResType } from "../../../cfw/res/ResInterface";
import ResItem from "../../../cfw/res/ResItem";

// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class AddGameMatrixLayer extends cc.Component {



    start() {
        ModuleManager.getLoader(ModuleID.PUBLIC).loadRes('prefabs/gameMatrix/GameMatrixLayer'
            , ResType.Prefab, (err, item: ResItem) => {
                if (err || !cc.isValid(this.node)) {
                    return;
                }
                let node: cc.Node = cc.instantiate(item.getRes())
                node.parent = this.node;
            })
    }

    // update (dt) {}
}
